//
//  MQLoginAndRegiterViewController.m
//  meiquan
//
//  Created by hejingjin on 2017/10/23.
//  Copyright © 2017年 mq. All rights reserved.
//

#import "MQLoginAndRegiterViewController.h"
#import "MQLoginAndRegisterview.h"
#import "MQLoginViewController.h"
#import "MQRegisterViewController.h"
// 登陆注册选择
@interface MQLoginAndRegiterViewController ()

@property(nonatomic,strong)MQLoginAndRegisterview *loginregisterview;

@end

@implementation MQLoginAndRegiterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    
    [self setUpMainInterface];
    
}


-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
}

-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    self.navigationController.navigationBar.hidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(void)setUpMainInterface{
    
    
    self.view.backgroundColor = BSTColorFromRGB(0xefefef);
    
    
    _loginregisterview = [MQLoginAndRegisterview loadLoginandregistrview];
    _loginregisterview.bst_x = 0;
    _loginregisterview.bst_y = 0;
    _loginregisterview.bst_width=BSTScreenW;
    _loginregisterview.bst_height = BSTScreenH;
    
    
    _loginregisterview.loginbutton.layer.cornerRadius = 4.f;
    _loginregisterview.loginbutton.layer.masksToBounds = YES;
    [_loginregisterview.loginbutton addTarget:self action:@selector(loginbuttonPressed:) forControlEvents:UIControlEventTouchUpInside];
    
    
    _loginregisterview.registerbutton.layer.cornerRadius = 4.f;
    _loginregisterview.registerbutton.layer.masksToBounds = YES;
    _loginregisterview.registerbutton.layer.borderWidth = 1.f;
    _loginregisterview.registerbutton.layer.borderColor = BSTColorFromRGB(0xff8e01).CGColor;
    [_loginregisterview.registerbutton addTarget:self action:@selector(registerbuttonPressed:) forControlEvents:UIControlEventTouchUpInside];
    
    
    
    
    [self.view addSubview:_loginregisterview];
}


-(void)loginbuttonPressed:(UIButton *)sender{
    
    MQLoginViewController *loginvc = [[MQLoginViewController alloc] init];
    
    [self.navigationController pushViewController:loginvc animated:YES];
    
}
-(void)registerbuttonPressed:(UIButton *)sender{
    
    MQRegisterViewController *registervc = [[MQRegisterViewController alloc] init];
    [self.navigationController pushViewController:registervc animated:YES];
    
    
}

@end
